package com.dinree.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.base.library.TopBarBaseActivity;
import com.dinree.R;
import com.dinree.databinding.ActivityRefereeBinding;
import com.jakewharton.rxbinding2.view.RxView;

import java.util.concurrent.TimeUnit;

import static com.base.library.Constant.WINDOW_DURATION;

/**
 * 是否有推荐人
 */
public class RefereeActivity extends TopBarBaseActivity {
    private ActivityRefereeBinding activityRefereeBinding;

    @Override
    public int getContentView() {
        return R.layout.activity_referee;
    }

    @Override
    public void initContentView(Bundle savedInstanceState) {
        activityRefereeBinding = getContentViewBinding();
        setTitle("填写推荐人");
        setTopLeftButton(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        RxView.clicks(activityRefereeBinding.btnYes).throttleFirst(WINDOW_DURATION, TimeUnit.SECONDS).subscribe(v -> {
            Intent intent = new Intent(mContext, EditRefereeActivity.class);
            startActivity(intent);
        });
        RxView.clicks(activityRefereeBinding.btnNo).throttleFirst(WINDOW_DURATION, TimeUnit.SECONDS).subscribe(v -> {
            Intent intent = new Intent(mContext, CompanyAuthActivity.class);
            startActivity(intent);
        });
    }
}

